from django.contrib.auth import logout
from django.views import View

from sportsground.utils.Res import Res


class LogoutView(View):
    """ 登出 """

    def get(self, request):
        logout(request)
        return Res.Json(Res.OK, msg="已退出")

    def post(self, request):
        return self.get()
